##C:\Contig.exe -a -s -v "c:\*" > c:\f.txt
import re
import sys
import codecs

f = open(sys.argv[1],"r")
fileData = f.read()
f.close()
files = {}

reobj = re.compile(r".:\\.* in \d* fragment")
results = reobj.findall(fileData)

for result in results:
    splitTemp = result.split(" ")
    fileName = splitTemp[0]
    numberOfFrag = splitTemp[len(splitTemp)-2]
    fileName = result[:-(16 + len(numberOfFrag))]
    
    if (numberOfFrag not in files):
        files[numberOfFrag] = []

    files[numberOfFrag].append(fileName)

f = open(r"c:\out.txt","w")
for key in files:
    print(key)

print ( )
print ( )
for key in files:
    if (int(key) > 50):
        for val in files[key]:
            print (key + " - " + val)
            f.write(key + " - " + val + "\n")
f.close()
